﻿@model MobileWebsiteGenerator.Entities.pictureGallery
@{
    ViewBag.Title = "Create";
    Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml";
}
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<link href="@Url.Content("~/Content/Css/uploadify.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/jquery.uploadify.js")" type="text/javascript"></script>
<script type="text/javascript">
    $(window).load(
    function () {
        $("#ImageUploader").fileUpload({
            'uploader': '/Scripts/uploader.swf',
            'cancelImg': '/Images/cancel.png',
            'buttonText': 'Select Image',
            'script': 'Upload',
            'folder': '@Url.Content("~/Uploads")',
            'fileDesc': 'Image Files',
            'fileExt': '*.jpg;*.jpeg;*.gif;*.png',
            'multi': true,
            'auto': true,
            'onComplete': function (event, ID, fileObj, response, data) {
                $("#ImagePath").attr("value", response);
            }
        });
    }
);
</script>
<h2>
    Create</h2>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>pictureGallery</legend>
        <div class="editor-label">
            @Html.LabelFor(model => model.ImagePath)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.ImagePath)
            @Html.ValidationMessageFor(model => model.ImagePath)
            <div id="ImageUploader">
            </div>
        </div>
        <p>
            <input type="submit" value="Create" />
        </p>
    </fieldset>
}
